//
//  TableViewController.m
//  ProjectSource_Demo
//
//  Created by Liu on 15/11/26.
//  Copyright © 2015年 AngryBear. All rights reserved.
//

#import "TableViewController.h"
#import "UITableViewCell+LXSaparateLine.h"
#import "UIImagePickerController+CustomShowPicker.h"

@interface TableViewController ()

@end

@implementation TableViewController

#pragma mark - UITableViewDataSource and UITableViewDelegate
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 10;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    if (indexPath.row == 0) {
        cell.textLabel.text = @"获取相册图片";
    }
    else if (indexPath.row == 1) {
        cell.textLabel.text = @"拍照";
    }
    cell.lx_bottomLine.hidden = NO;
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row == 0) {
        [UIImagePickerController showImagePickerWithSourceVC:self sourceType:UIImagePickerControllerSourceTypePhotoLibrary dismissBlock:^(UIImagePickerController *picker, UIImage *image, BOOL finished) {
            NSLog(@"%@ %@ %d", picker, image, finished);
        }];
    }
    else if (indexPath.row == 1) {
        [UIImagePickerController showImagePickerWithSourceVC:self sourceType:UIImagePickerControllerSourceTypeCamera dismissBlock:^(UIImagePickerController *picker, UIImage *image, BOOL finished) {
            NSLog(@"%@ %d", image, finished);
        }];
    }
}




@end
